package com.gitee.wsl.mathematics.level.matrix

import com.gitee.wsl.mathematics.vector.MutableVector
import com.gitee.wsl.mathematics.vector.vec2.MutableVec2
import com.gitee.wsl.mathematics.vector.vec3.MutableVec3

/**
 * Represents a Game Dimension.
 */
enum class Dimension {

    /**
     * Represents a 2D Plane.
     */
    TWO,

    /**
     * Represents a 3D Space.
     */
    THREE

    ;

    /**
     * Gets if this dimension is 2D.
     * @return true if 2D, false if 3D
     */
    val is2D: Boolean
        get() = this == TWO

    /**
     * Gets if this dimension is 3D.
     * @return true if 3D, false if 2D
     */
    val is3D: Boolean
        get() = this == THREE

    /**
     * Gets the default Vector<*> for this dimension.
     * @return Default Vector<*>
     */
    val defaultCoordinate: MutableVector<Double,*>
        get() = if (is2D) MutableVec2(0, 0) else MutableVec3(0, 0, 0)

    /**
     * Gets the number of dimensions.
     * @return Number of Dimensions
     */
    val asNumber: Int
        get() = if (is2D) 2 else 3

}